#include "Texture.h"
#include "RendererAPI.h"
#include "Fysics/GraphicsAPI/OpenGL/OpenGLTexture.h"

namespace Fysics
{
	Texture::Texture(const std::string& path, TextureType type)
		: m_Path(path), m_Type(type)
	{
	}

	Texture* Texture::Create(std::string path, TextureType type, bool& outSuccess)
	{
		switch (GetAPI())
		{
		case RendererAPI::OpenGL:
			return new OpenGLTexture(path, type, outSuccess);
		}
		return nullptr;
	}

	Texture* Texture::Create(int width, int height, unsigned char* buffer)
	{
		switch (GetAPI())
		{
		case RendererAPI::OpenGL:
			return new OpenGLTexture(buffer, width, height);
		}
		return nullptr;
	}

	void Fysics::Texture::SetType(TextureType type)
	{
		m_Type = type;
	}
}